package SwingController;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import Main.Main;
import SwingModel.CmsUser;
import SwingView.CmsLoginView;
import SwingView.CmsMainView;

public class ALLogout implements ActionListener{

	CmsMainView mainView;
	CmsLoginView loginView;
	CmsUser user;
	
	//---------------------------------------------------------
	//CONSTRUCTOR:
	//---------------------------------------------------------
	public ALLogout(CmsMainView mainView, CmsLoginView loginView, CmsUser user){
		this.mainView = mainView;
		this.loginView = loginView;
		this.user = user;
	}
	
	//---------------------------------------------------------
	//PERFORMING ACTION:
	//---------------------------------------------------------
	@Override
	public void actionPerformed(ActionEvent e) {
		mainView.setVisible(false);
		loginView.setVisible(false);
		mainView = null;
		loginView = null;
		user = null;
		
		Main.main(null);//restart application
	}
}
